<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>mechanoChemIGA: User defined functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">mechanoChemIGA
   &#160;<span id="projectnumber">0.2.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="codestructure.html"><span>Code&#160;structure</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li><a href="modules.html"><span>Functions</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="https://github.com/mechanoChem/mechanoChem"><span>GitHub&#160;code&#160;repo</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">User defined functions</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4bb6b6363788ea6d3af2c543955ee029"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:ga4bb6b6363788ea6d3af2c543955ee029"><td class="memTemplItemLeft" align="right" valign="top">double&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#ga4bb6b6363788ea6d3af2c543955ee029">scalarInitialConditions</a> (const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;x, unsigned int scalar_i, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user)</td></tr>
<tr class="separator:ga4bb6b6363788ea6d3af2c543955ee029"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3c9dadedbc328dc0a3006f072b08a55"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:gac3c9dadedbc328dc0a3006f072b08a55"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#gac3c9dadedbc328dc0a3006f072b08a55">vectorInitialConditions</a> (const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;x, unsigned int vector_i, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user)</td></tr>
<tr class="separator:gac3c9dadedbc328dc0a3006f072b08a55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacaf804e621998c5c9794a46d3212afbb"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:gacaf804e621998c5c9794a46d3212afbb"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#gacaf804e621998c5c9794a46d3212afbb">boundaryConditions</a> (<a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user, double scale)</td></tr>
<tr class="separator:gacaf804e621998c5c9794a46d3212afbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga397c8fb1bf91992fb38944806aa864cf"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:ga397c8fb1bf91992fb38944806aa864cf"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#ga397c8fb1bf91992fb38944806aa864cf">loadStep</a> (unsigned int step, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user)</td></tr>
<tr class="separator:ga397c8fb1bf91992fb38944806aa864cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae605154e592215f58a1b4c68396db2d0"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:gae605154e592215f58a1b4c68396db2d0"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#gae605154e592215f58a1b4c68396db2d0">adaptiveTimeStep</a> (unsigned int step, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user)</td></tr>
<tr class="separator:gae605154e592215f58a1b4c68396db2d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga31a2f2e526abaf0b8a00c2623e14f22e"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:ga31a2f2e526abaf0b8a00c2623e14f22e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#ga31a2f2e526abaf0b8a00c2623e14f22e">projectFields</a> (const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;x, const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;normal, const <a class="el" href="classsolution_scalars.html">solutionScalars</a>&lt; dim, double &gt; &amp;c, const <a class="el" href="classsolution_vectors.html">solutionVectors</a>&lt; dim, double &gt; &amp;u, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user, std::vector&lt; double &gt; &amp;scalarProjections, std::vector&lt; <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &gt; &amp;vectorProjections)</td></tr>
<tr class="separator:ga31a2f2e526abaf0b8a00c2623e14f22e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadbccf6631ad847d5a681a548f921ef29"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim&gt; </td></tr>
<tr class="memitem:gadbccf6631ad847d5a681a548f921ef29"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#gadbccf6631ad847d5a681a548f921ef29">defineParameters</a> (<a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user)</td></tr>
<tr class="separator:gadbccf6631ad847d5a681a548f921ef29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab9195b3f02c923dafb2c742df293db7d"><td class="memTemplParams" colspan="2">template&lt;unsigned int dim, typename T &gt; </td></tr>
<tr class="memitem:gab9195b3f02c923dafb2c742df293db7d"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__user_functions.html#gab9195b3f02c923dafb2c742df293db7d">residual</a> (bool dV, bool dS, const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;x, const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;normal, const <a class="el" href="classsolution_scalars.html">solutionScalars</a>&lt; dim, T &gt; &amp;c, const <a class="el" href="classsolution_vectors.html">solutionVectors</a>&lt; dim, T &gt; &amp;u, const <a class="el" href="classtest_function_scalars.html">testFunctionScalars</a>&lt; dim, T &gt; &amp;w1, const <a class="el" href="classtest_function_vectors.html">testFunctionVectors</a>&lt; dim, T &gt; &amp;w2, <a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;user, Sacado::Fad::SimpleFad&lt; T &gt; &amp;r)</td></tr>
<tr class="separator:gab9195b3f02c923dafb2c742df293db7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This is a collection of fuctions that require (viz. defineParameters, residual) or allow user definitions. The optional user defined functions involve defining a function and assigning it to one of the function pointers included in the AppCtx structure. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gae605154e592215f58a1b4c68396db2d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void adaptiveTimeStep </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>step</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Specify any adaptive time step schemes (i.e. change the value of dt based on current conditions). Called at each time/load step.</p>
<p>Defaults to no adaptive time stepping. </p>

</div>
</div>
<a class="anchor" id="gacaf804e621998c5c9794a46d3212afbb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void boundaryConditions </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>scale</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define the Dirichlet boundary conditions using PetIGA's function. This function defines a uniform value for a given solution field on a face, using the following notation:</p>
<p>IGASetBoundaryValue(user.iga,"axis (0,1,2)","boundary (0,1)","dof_index","value")</p>
<p>Potentially called multiple times. The input scale can be used to scale the value of the boundary condition if load stepping is being used.</p>
<p>Defaults to no Dirichlet boundary conditions. </p>

</div>
</div>
<a class="anchor" id="gadbccf6631ad847d5a681a548f921ef29"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void defineParameters </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function to define any necessary variables in the AppCtx struct. For example, this function is used to set material parameters, define the problem domain and the mesh, set the basis function order, etc. It is also used to set available function pointers to user defined functions. Called once at the beginning of the code.</p>
<p>This function must be defined by the user. </p>

</div>
</div>
<a class="anchor" id="ga397c8fb1bf91992fb38944806aa864cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void loadStep </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>step</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define any load stepping (i.e. change in Dirichlet b.c.s). Called at each time/load step. This would usually involve calling the boundaryConditions function with an adjusted value for the input scale.</p>
<p>Defaults to no load stepping. </p>

</div>
</div>
<a class="anchor" id="ga31a2f2e526abaf0b8a00c2623e14f22e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void projectFields </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>normal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsolution_scalars.html">solutionScalars</a>&lt; dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsolution_vectors.html">solutionVectors</a>&lt; dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; double &gt; &amp;&#160;</td>
          <td class="paramname"><em>scalarProjections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>vectorProjections</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defining the scalar and vector fields (defined at the quadrature point) to be projected to the nodes and included in the output file.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>gives the coordinates of the quadrature point. </td></tr>
    <tr><td class="paramname">normal</td><td>gives the unit normal for a surface quadrature point. </td></tr>
    <tr><td class="paramname">c</td><td>gives the information (values, gradients, etc.) for the scalar solution fields at the current quadrature point (see documentation for solutionScalars class). </td></tr>
    <tr><td class="paramname">u</td><td>gives the information (values, gradients, etc.) for the vector solution fields at the current quadrature point (see documentation for solutionVectors class). </td></tr>
    <tr><td class="paramname">user</td><td>is a structure available for parameters related to the initial boundary value problem (e.g. elasticity tensor). </td></tr>
    <tr><td class="paramname">scalarProjections</td><td>stores the scalar values calculated at the quadrature points that are to be projected to the nodes. </td></tr>
    <tr><td class="paramname">vectorProjectionsvector</td><td>stores the vector values calculated at the quadrature points that are to be projected to the nodes.</td></tr>
  </table>
  </dd>
</dl>
<p>The stored values and location in the <code>scalarProjections</code> and <code>vectorProjectionsvector</code> vectors should correspond the name and location defined in the defineParameters function.</p>
<p>Defaults to zero valued fields. </p>

</div>
</div>
<a class="anchor" id="gab9195b3f02c923dafb2c742df293db7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void residual </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>dV</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>dS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>normal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsolution_scalars.html">solutionScalars</a>&lt; dim, T &gt; &amp;&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classsolution_vectors.html">solutionVectors</a>&lt; dim, T &gt; &amp;&#160;</td>
          <td class="paramname"><em>u</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classtest_function_scalars.html">testFunctionScalars</a>&lt; dim, T &gt; &amp;&#160;</td>
          <td class="paramname"><em>w1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classtest_function_vectors.html">testFunctionVectors</a>&lt; dim, T &gt; &amp;&#160;</td>
          <td class="paramname"><em>w2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Sacado::Fad::SimpleFad&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>r</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function defining the residual of the problem, in a format closely following the analytical weak form. The value of the residual is stored in the variable r</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dV</td><td>is a boolean, "true" if <code>residual</code> is being called for the volume integral and "false" if <code>residual</code> is being called for the surface integral. </td></tr>
    <tr><td class="paramname">dS</td><td>is a boolean, "false" if <code>residual</code> is being called for the volume integral and "true" if <code>residual</code> is being called for the surface integral. </td></tr>
    <tr><td class="paramname">x</td><td>gives the coordinates of the quadrature point. </td></tr>
    <tr><td class="paramname">normal</td><td>gives the unit normal for a surface quadrature point. </td></tr>
    <tr><td class="paramname">c</td><td>gives the information (values, gradients, etc.) for the scalar solution fields at the current quadrature point (see documentation for solutionScalars class). </td></tr>
    <tr><td class="paramname">u</td><td>gives the information (values, gradients, etc.) for the vector solution fields at the current quadrature point (see documentation for solutionVectors class). </td></tr>
    <tr><td class="paramname">w1</td><td>gives the information for the scalar test functions. </td></tr>
    <tr><td class="paramname">w2</td><td>gives the information for the vector test functions. </td></tr>
    <tr><td class="paramname">user</td><td>is a structure available for parameters related to the initial boundary value problem (e.g. elasticity tensor). </td></tr>
    <tr><td class="paramname">r</td><td>stores the scalar value of the residual for the weak form of the PDE which is then used by the core assembly functions.</td></tr>
  </table>
  </dd>
</dl>
<p>See also the documentation for the Tensor class.</p>
<p>As an example, the weak form for finite strain elasticity: <img class="formulaInl" alt="$\int_\Omega (\nabla{\boldsymbol{w}}:\boldsymbol{P}) d\mathrm{V} - \int_{\partial\Omega} (\boldsymbol{w}\cdot\boldsymbol{h}) d\mathrm{S}$" src="form_38.png"/> would be represented by the following line of code:</p>
<div class="fragment"><div class="line">r = <a class="code" href="class_tensor.html#a5a8bda2f027340305afc45b49388bcc8">double_contract</a>(w2.<a class="code" href="classtest_function_vectors.html#ac178383f83c18393f2d61f02793fce93">grad</a>(0),P)*dV - ((w2.<a class="code" href="classtest_function_vectors.html#a2c3f7998bd59d6cc139d4e23dc711079">val</a>(0)*h)*dS; </div>
</div><!-- fragment --><p>where P is a user-defined 2nd order tensor and h is a user-defined 1st order tensor.</p>
<p>This function must be defined by the user. </p>

</div>
</div>
<a class="anchor" id="ga4bb6b6363788ea6d3af2c543955ee029"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double scalarInitialConditions </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>scalar_i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define the initial conditions of the IBVP for scalar fields. Return the initial value for scalar solution field with label scalar_i for the node located at the point x.</p>
<p>Defaults to a zero initial condition. </p>

</div>
</div>
<a class="anchor" id="gac3c9dadedbc328dc0a3006f072b08a55"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_tensor.html">Tensor</a>&lt;1,dim,double&gt; vectorInitialConditions </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_tensor.html">Tensor</a>&lt; 1, dim, double &gt; &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>vector_i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_app_ctx.html">AppCtx</a>&lt; dim &gt; &amp;&#160;</td>
          <td class="paramname"><em>user</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Define the initial conditions of the IBVP for vector fields. Return the initial value (1st order tensor) for vector solution field with label vector_i for the node located at the point x.</p>
<p>Defaults to a zero initial condition. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
